﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;

//------------------------------------------------------------
// shaco Framework
// Copyright © 2017-2021 chang.liu All rights reserved.
// Feedback: 449612236@qq.com
//------------------------------------------------------------

namespace shacoEditor
{
    /// <summary>
    /// 编辑器管理中心，负责编辑器使用类的管理
    /// </summary>
    [System.Diagnostics.DebuggerStepThrough]
    public class GameHelper : shaco.Base.IGameHelper
    {
        /// <summary>
        /// 读取spine二进制文件接口
        /// </summary>
        [shaco.Base.GameInterfaceTypeAtrribute("Spine Binary Reader", "Unity Editor C#")]
        static public shacoEditor.ISpineBinaryReader spineBinaryReader
        {
            get { if (null == _spineBinaryReader) _spineBinaryReader = GetOrSetDefaultInterface<shacoEditor.ISpineBinaryReader, shacoEditor.SpineBinaryReader>(); return _spineBinaryReader; }
            set { BindInterface<shacoEditor.ISpineBinaryReader>(value); _spineBinaryReader = value; }
        }
        static private shacoEditor.ISpineBinaryReader _spineBinaryReader = null;

        /// <summary>
        /// 开关Inspector预览窗口下的自动播放
        /// </summary>
        [shaco.Base.GameInterfaceTypeAtrribute("Auto Play Preview Anim", "Unity Editor C#", true)]
        static public bool isAutoPlayPreviewAnimation
        {
            get { return EditorPrefs.GetBool("shacoEditor.GameHelper.isAutoPlayPreviewAnimation", false); }
            set
            {
                EditorPrefs.SetBool("shacoEditor.GameHelper.isAutoPlayPreviewAnimation", value);
            }
        }
    }
}